#ifndef EE_UIHELPER_HPP
#define EE_UIHELPER_HPP

#include "base.hpp"

namespace EE { namespace UI {

Uint32 EE_API HAlignGet( Uint32 Flags );

Uint32 EE_API VAlignGet( Uint32 Flags );

enum UI_CONTROL_FLAGS_VALUES {
	UI_CTRL_FLAG_CLOSE								= (1<<0),
	UI_CTRL_FLAG_CLOSE_FO							= (1<<1),
	UI_CTRL_FLAG_ANIM								= (1<<2),
	UI_CTRL_FLAG_MOUSEOVER							= (1<<3),
	UI_CTRL_FLAG_HAS_FOCUS							= (1<<4),
	UI_CTRL_FLAG_SELECTED							= (1<<5),
	UI_CTRL_FLAG_DISABLE_FADE_OUT					= (1<<6),
	UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD				= (1<<7),
	UI_CTRL_FLAG_DRAGGING							= (1<<8),
	UI_CTRL_FLAG_DRAGABLE							= (1<<9),
	UI_CTRL_FLAG_COMPLEX							= (1<<10),
	UI_CTRL_FLAG_SKIN_OWNER							= (1<<11),
	UI_CTRL_FLAG_FREE_USE							= (1<<31)
};

#define UI_HALIGN_LEFT		FONT_DRAW_LEFT
#define UI_HALIGN_MASK		FONT_DRAW_HALIGN_MASK
#define UI_VALIGN_TOP		FONT_DRAW_TOP
#define UI_VALIGN_MASK		FONT_DRAW_VALIGN_MASK

enum UI_FLAGS {
	UI_HALIGN_RIGHT					= FONT_DRAW_RIGHT,
	UI_HALIGN_CENTER				= FONT_DRAW_CENTER,
	UI_VALIGN_BOTTOM				= FONT_DRAW_BOTTOM,
	UI_VALIGN_CENTER				= FONT_DRAW_MIDDLE,
	UI_DRAW_SHADOW					= FONT_DRAW_SHADOW,
	UI_AUTO_SIZE					= (1 << 6),
	UI_INGORE_FOCUS					= (1 << 7),
	UI_FILL_BACKGROUND				= (1 << 8),
	UI_BORDER						= (1 << 9),
	UI_TAB_STOP						= (1 << 10),
	UI_FIT_TO_CONTROL				= (1 << 11),
	UI_CLIP_ENABLE					= (1 << 12),
	UI_AUTO_SHRINK_TEXT				= (1 << 13),
	UI_MULTI_SELECT					= (1 << 14),
	UI_AUTO_PADDING					= (1 << 15),
	UI_DRAG_ENABLE					= (1 << 16),
	UI_REPORT_SIZE_CHANGE_TO_CHILDS = (1 << 17),
	UI_ANCHOR_TOP					= (1 << 18),
	UI_ANCHOR_BOTTOM				= (1 << 19),
	UI_ANCHOR_LEFT					= (1 << 20),
	UI_ANCHOR_RIGHT					= (1 << 21),
	UI_AUTO_FIT						= (1 << 22)
};

enum UI_CONTROL_TYPES {
	UI_TYPE_CONTROL	= 0,
	UI_TYPE_CONTROL_DRAGABLE,
	UI_TYPE_CONTROL_ANIM,
	UI_TYPE_CONTROL_COMPLEX,
	UI_TYPE_GFX,
	UI_TYPE_SPRITE,
	UI_TYPE_TEXTBOX,
	UI_TYPE_TEXTINPUT,
	UI_TYPE_PUSHBUTTON,
	UI_TYPE_CHECKBOX,
	UI_TYPE_RADIOBUTTON,
	UI_TYPE_SLIDER,
	UI_TYPE_SPINBOX,
	UI_TYPE_SCROLLBAR,
	UI_TYPE_PROGRESSBAR,
	UI_TYPE_LISTBOX,
	UI_TYPE_LISTBOXITEM,
	UI_TYPE_DROPDOWNLIST,
	UI_TYPE_SEPARATOR,
	UI_TYPE_COMBOBOX,
	UI_TYPE_MENU,
	UI_TYPE_MENUITEM,
	UI_TYPE_MENUCHECKBOX,
	UI_TYPE_MENUSUBMENU,
	UI_TYPE_TEXTEDIT,
	UI_TYPE_TOOLTIP,
	UI_TYPE_GENERICGRID,
	UI_TYPE_WINDOW,
	UI_TYPE_WINMENU,
	UI_TYPE_SELECTBUTTON,
	UI_TYPE_POPUPMENU,
	UI_TYPE_COMMONDIALOG,
	UI_TYPE_TAB,
	UI_TYPE_TABWIDGET,
	UI_TYPE_USER = 100
};

enum UI_SCROLLBAR_MODE {
	UI_SCROLLBAR_AUTO,
	UI_SCROLLBAR_ALWAYS_ON,
	UI_SCROLLBAR_ALWAYS_OFF
};

enum UI_MANAGER_FLAGS {
	UI_MANAGER_HIGHLIGHT_FOCUS	= ( 1 << 0 )
};

enum UI_WINDOW_FLAGS {
	UI_WIN_NO_BORDER					= ( 1 << 0 ),
	UI_WIN_CLOSE_BUTTON					= ( 1 << 1 ),
	UI_WIN_MINIMIZE_BUTTON				= ( 1 << 2 ),
	UI_WIN_MAXIMIZE_BUTTON				= ( 1 << 3 ),
	UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS	= ( 1 << 4 ),
	UI_WIN_RESIZEABLE					= ( 1 << 5 ),
	UI_WIN_DRAGABLE_CONTAINER			= ( 1 << 6 ),
	UI_WIN_SHARE_ALPHA_WITH_CHILDS		= ( 1 << 7 ),
	UI_WIN_MODAL						= ( 1 << 8 ),
	UI_WIN_DRAW_SHADOW					= ( 1 << 9 )
};

enum UI_COMMON_DIALOG_FLAGS {
	CDL_FLAG_SAVE_DIALOG			= ( 1 << 0 ),
	CDL_FLAG_FOLDERS_FISRT			= ( 1 << 1 ),
	CDL_FLAG_SORT_ALPHABETICALLY	= ( 1 << 2 ),
	CDL_FLAG_ALLOW_FOLDER_SELECT	= ( 1 << 3 )
};

enum UI_MSGBOX_TYPE {
	MSGBOX_OKCANCEL,
	MSGBOX_YESNO,
	MSGBOX_RETRYCANCEL,
	MSGBOX_OK
};

static const Uint32 UI_CONTROL_DEFAULT_ALIGN = UI_HALIGN_LEFT | UI_VALIGN_CENTER;

static const Uint32 UI_CONTROL_ALIGN_CENTER = UI_HALIGN_CENTER | UI_VALIGN_CENTER;

static const Uint32 UI_CONTROL_DEFAULT_ANCHOR = UI_ANCHOR_LEFT | UI_ANCHOR_TOP;

static const Uint32 UI_CONTROL_DEFAULT_FLAGS = UI_CONTROL_DEFAULT_ANCHOR | UI_CONTROL_DEFAULT_ALIGN;

static const Uint32 UI_CONTROL_DEFAULT_FLAGS_CENTERED = UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_HALIGN_CENTER | UI_VALIGN_CENTER;

static const Uint32 UI_WIN_DEFAULT_FLAGS = UI_WIN_CLOSE_BUTTON | UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS | UI_WIN_RESIZEABLE | UI_WIN_SHARE_ALPHA_WITH_CHILDS;

static const Uint32 UI_CDL_DEFAULT_FLAGS = CDL_FLAG_FOLDERS_FISRT | CDL_FLAG_SORT_ALPHABETICALLY;

}}

#endif
